<template>
    <div class="d-inline-block line-height-1 px-2 pt-2" style="border:1px solid" :style="{borderColor:obj.color,backgroundColor:obj.bg}">{{obj.label}}</div>
</template>

<script>
    export default {
        name: "sign-dict",
        props: {type: "",value:""},
        data(){
            return {
                obj:{},
            }
        },
        mounted() {
            // console.log('this.type')
            // console.log(this.type);
            if(this.type == 'car'){
                if(this.value == 0){
                    this.obj = {
                        label:'单车',
                        color:"#947637",
                        bg:"rgba(148,118,55,0.5)",
                    }
                }else if(this.value == 1){
                    this.obj = {
                        label:'多车',
                        color:"#947637",
                        bg:"rgba(148,118,55,0.5)",
                    }
                }

            }else if(this.type == "casualties"){
                if(this.value == 0){
                    this.obj = {
                        label:'无伤亡',
                        color:"#8B5735",
                        bg:"rgba(139,87,53,0.5)",
                    }
                }else if(this.value == 1){
                    this.obj = {
                        label:'伤人',
                        color:"#8B5735",
                        bg:"rgba(139,87,53,0.5)",
                    }
                }
            }else if(this.type == "trafficControl"){

                if(this.value == 0){
                    this.obj = {
                        label:'封闭',
                        color:"#8B5735",
                        bg:"rgba(139,87,53,0.5)",
                    }
                }else if(this.value == 1){
                    this.obj = {
                        label:'限行',
                        color:"#947637",
                        bg:"rgba(148,118,55,0.5)",
                    }
                }else if(this.value == 2){
                    this.obj = {
                        label:'分流',
                        color:"#947637",
                        bg:"rgba(148,118,55,0.5)",
                    }
                }else if(this.value == 3){
                    this.obj = {
                        label:'借道通行',
                        color:"#947637",
                        bg:"rgba(148,118,55,0.5)",
                    }
                }else if(this.value == 4){
                    this.obj = {
                        label:'其他措施',
                        color:"#947637",
                        bg:"rgba(148,118,55,0.5)",
                    }
                }
            }

        }
    }
</script>

<style scoped>

</style>
